const express = require('express')

const app = express()

app.get('/',(req,res)=> {
    res.send('8000 index')
})

app.get('/home',(req,res)=> {
    res.send({
        name:'home',
        msg:'express 入门'
    })
})

app.post('/add',(req,res)=> {
    res.send({
        msg:'post request',
        method:'post'
    })
})

app.listen(8000,()=> {
    console.log('8000 running')
})


// const express = require('express')
/* const app1 = express()
app1.get('/',(req,res)=>{
    res.send('success')
})

app1.listen(8080,()=>{
    console.log('8080 run')
}) */